$(function () {
    let setp = 0;
    let onlyWarpDOM = $(".only-warp");
    let onlyMenuDOM = $(".only-warp-menu");

    $(".only-ul-li>.et-menu-toggle").click(function (e) {
        e.stopPropagation();

        let onlyWarpWidth = onlyWarpDOM.width();
        if ($(this).parent().children(".panel-menu-ul").length) {
            setp++;
            e.preventDefault();
            onlyMenuDOM.css({ left: -onlyWarpWidth * setp });
            $(this).parent().children(".panel-menu-ul").addClass("only-ul-show");
        }
    });
    $(".panel-menu-parent").click(function (e) {
        e.stopPropagation();
        let onlyWarpWidth = onlyWarpDOM.width();
        setp--;

        $(this).parent().removeClass("only-ul-show");
        onlyMenuDOM.css({ left: -onlyWarpWidth * setp });
    });
});

$.componentInject(_COMPONENT_NAME_, function (params) {
    if(params.id){
        $("oem-drawer[_COMPONENT_NAME_ATTR_="+params.id+"]").oemDrawer()
    }
});
